package com.slx.sthq.controller;


import com.slx.sthq.common.page.PageQuery;
import com.slx.sthq.common.page.TableDataInfo;
import com.slx.sthq.domain.R;


import com.slx.sthq.domain.Wjlb;
import com.slx.sthq.domain.qo.SearchQo;
import com.slx.sthq.service.ZfwSearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@RestController
@RequestMapping("/model")
@Api(tags = "模版")
@Validated
public class ModelController extends BaseController {

    @Resource
    private ZfwSearchService zfwSearchService;

    @GetMapping(value = "/getId")
    @ApiOperation(value = "get请求")
    public TableDataInfo<Wjlb> getId(SearchQo qo, PageQuery pageQuery) {
        TableDataInfo<Wjlb> pageList = zfwSearchService.queryPageList(qo, pageQuery);
        return pageList;
    }

    @PostMapping(value = "/getResult")
    @ApiOperation(value = "post请求")
    public R getResult(@RequestBody SearchQo questionQo) {

        return R.ok(questionQo);
    }

    @DeleteMapping(value = "/delAsk/{id}")
    @ApiOperation(value = "问题记录删除")
    public R delAskAndAns(@PathVariable Long id) {
        System.out.println(id);
        return toAjax(Math.toIntExact(id));
    }
}
